package lab03.test09;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;


public class Test {
    public static void main(String[] args)throws IOException {


        Book x1=new Book("1001","Java程序设计","第2版", 56.9f,560);

        Book x2=new Book("1002","Java开发实战","第1版", 98.9f,820);

        Book x3=new Book("1003","C++程序设计指南","第3版", 62.5f,362);

        Book x4=new Book("1004","EJB3.0入门经典","第1版", 59.8f,1280);

        Book x5=new Book("1005","Spring3.0 in Action","第3版", 95.8f,1189);

        Book book[]={x1,x2,x3,x4,x5};

        String a="编号\t名称\t\t版本\t价格\t销售额\r\n";

        for (int i=0;i<book.length;i++){

            a=a+book[i]+"\r\n";
        }
        File file=new File("e"+File.separator+"book.txt");

        Writer out=null;

        out=new FileWriter(file);

        out.write(a);

        out.close();
    }

}